package sample.stormax.pres.news;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import sample.stormax.pres.news.utils.sharepres.ISharePreferenceOperation;
import sample.stormax.pres.news.utils.sharepres.SPUtils;

public class WelcomeActivity extends AppCompatActivity {

    ISharePreferenceOperation sharePreferenceOp;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);

        sharePreferenceOp = new SPUtils(this);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (!sharePreferenceOp.isFirstLoad()) {
                    startActivity(new Intent(WelcomeActivity.this, MainActivity.class));
                }
                else {
                    startActivity(new Intent(WelcomeActivity.this, GuideActivity.class));
                }
                finish();
            }
        }, 3000);
    }
}
